package com.xmut.mall.coupon.feign;

import com.xmut.mall.coupon.utils.RespBean;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

@FeignClient("mall-member")
public interface MemberFeignService {

    /**
     * 用户领取优惠券
     * @param params
     * @return
     */
    @PostMapping("/member/membercouponrelation/userReceiveCoupon")
    RespBean userReceiveCoupon(@RequestBody Map<String,Object> params);

    /**
     * 查询用户领取了几次当前id的优惠券
     * @param couponId
     * @param userId
     * @return
     */
    @GetMapping("/member/membercouponrelation/getUserReceiveCouponNum/{couponId}/{userId}")
    RespBean getUserReceiveCouponNum(@PathVariable("couponId") Long couponId, @PathVariable("userId") Long userId);
}
